<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
<%@page import="java.util.Map"%>
<%@page import="java.util.List"%>
<%@page import="java.sql.Connection"%>
<%@page import="by.epam.communalservices.dao.jdbc.JdbcDaoJkhWorker"%>
<%@page import="by.epam.communalservices.entity.JkhWorker"%>



<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags/connect" prefix="connect"%>
<%@ taglib tagdir="/WEB-INF/tags/worker" prefix="worker"%>
<%@ taglib tagdir="/WEB-INF/tags/table" prefix="table"%>

<connect:isset/>
<connect:denny rules="admin,view,worker_view,kadrovik,brigadir" />


<worker:list/>

<table:body>
	<table:title span="8">
	   Worker list!!!
	</table:title>
	<table:head names="id,surname,name,patronymic,specialty,rate,team,actions" />
	<c:set var="index" value="0" />
	<c:forEach items="${requestScope.workerList}" var="worker">
		<c:set var="index" value="${index + 1}" />
		<worker:line  worker="${worker}" dif="${index mod 2 eq 0 ? 'c' : 'n'}" />	
	</c:forEach>

	<table:title span="8" down="yes">
		<connect:display rules="admin,worker_edit,edit,kadrovik">
			<button onclick="document.location.href='worker_edit'"
				style='float: right;'>Add New Worker</button>
		</connect:display>
	</table:title>
</table:body>
